<template>
  <div class="data_bodey">
  <MyHeader  v-if="$route.meta.requiresAuth"/>
    <!-- 内容部分-->
    <!-- <keep-alive>
      <router-view />
    </keep-alive> -->

    <router-view v-slot="{ Component }">
         <keep-alive>
           <component :is="Component" v-if="$route.meta.keepAlive" />
         </keep-alive>
         <component :is="Component" v-if="!$route.meta.keepAlive" />
       </router-view>
    <MyLoading v-show="isLoading" />
  </div>
</template>

<script>
import MyHeader from "@/components/MyHeader.vue";
import MyLoading from "@/components/MyLoading.vue";
export default {
  name: "MyHome",
  components: {
    MyHeader,
    MyLoading,
  },
 
  computed: {
    isLoading() {
      return this.$store.state.isLoading;
    },
  },

};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
